package com.traffic.between.plugin;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import com.jfinal.plugin.IPlugin;
import com.traffic.between.redis.running.BsmOrderGoodsWorker;
import com.traffic.between.redis.running.BsmOrderStatusWorker;

public class RedisOrderQueuePlugin implements IPlugin {

	private static final ExecutorService pool = Executors.newFixedThreadPool(7);

	public boolean start() {
		for (int i = 0; i < 7; i++) {
			pool.submit(new BsmOrderGoodsWorker());
		}
//		for (int i = 0; i < 7; i++) {
//		pool.submit(new BsmOrderStatusWorker());
//		}
//			
			
		return true;
	}

	public boolean stop() {
		pool.shutdown();
		return true;
	}

}
